package com.xuxk.project.library.service.impl;
import java.util.HashMap;
import java.util.List;
import com.github.pagehelper.Page;
import org.apache.ibatis.session.RowBounds;
import java.util.Map;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import com.xuxk.project.library.dao.XuxkBookingDao;
import com.xuxk.project.library.bean.XuxkBooking;
import com.xuxk.project.library.dto.XuxkBookingDto;
import com.xuxk.project.library.vo.XuxkBookingVo;
import com.xuxk.project.library.service.XuxkBookingService;


/**
 * Manager implementation for XuxkBooking, responsible for business processing, and communicate between web and persistence layer.
 * @author 橙云科技有限公司
 */
@Service
public class XuxkBookingServiceImpl implements XuxkBookingService {

	@Resource
	private XuxkBookingDao xuxkBookingDao;
    @Override
	public Page<XuxkBookingVo>  listXuxkBookings(Map<String, Object> map, RowBounds rowBounds){

        Page<XuxkBookingVo> xuxkBookingPage =  xuxkBookingDao.listXuxkBookings(map,rowBounds);
		return xuxkBookingPage;
	}
    @Override
	public List<XuxkBooking> listXuxkBookingByDto(XuxkBookingDto dto){


		return xuxkBookingDao.listByDto(dto);
	}

    @Override
	public void deleteXuxkBooking(Integer id )  {
	    Map<String,Object> map = new HashMap<>();
        map.put("id",id);

		xuxkBookingDao.deleteByPrimaryKey(map);
	}

    /**
    * 全量更新
    * @return
    */
    @Override
    public Integer updateXuxkBooking(XuxkBooking xuxkBooking)  {


        return xuxkBookingDao.updateXuxkBooking(xuxkBooking);
    }

    /**
    * 部分更新
	* @return
	*/
    @Override
    public Integer patchUpdateXuxkBooking(XuxkBooking xuxkBooking)  {

        return xuxkBookingDao.patchUpdateXuxkBooking(xuxkBooking);

    }

    /**
    * 新增
	* @return
	*/
    @Override
    public Integer insertXuxkBooking(XuxkBooking xuxkBooking)  {


		xuxkBookingDao.insertSelective(xuxkBooking);

        return xuxkBooking.getId();

    }
    @Override
    public XuxkBooking getXuxkBooking(Integer id ){
        Map<String,Object> map = new HashMap<>();
        map.put("id",id);
        return xuxkBookingDao.getXuxkBooking(map);
    }

}